package com.baizhi.controller;

import com.baizhi.dao.FeedbackMapper;
import com.baizhi.entity.Feedback;
import com.baizhi.service.FeedbackService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@CrossOrigin    //处理跨域
@RestController
@RequestMapping("feedback")
public class FeedbackController {

    private static final Logger log = LoggerFactory.getLogger(FeedbackController.class);

    @Resource
    FeedbackService feedbackService;

    @RequestMapping("queryAllPage")
    public HashMap<String,Object> queryAllPage(Integer page, Integer pageSize){
        log.info("当前页面page:{}",page);
        log.info("每页展示pageSize:{}",pageSize);

        HashMap<String, Object> map = feedbackService.queryAllPage(page, pageSize);
        return map;
    }
    @PostMapping("delete")
    public HashMap<String,Object> delete(@RequestBody Feedback feedback){
        HashMap<String, Object> map = feedbackService.delete(feedback);
        return map;
    }

}
